package com.cos.web.controller;

import com.cos.services.TestServices;
import com.cos.services.impl.TestServicesImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.security.RolesAllowed;

/**
 * @author: COS
 * @time: 2021/11/23 10:20
 * @description:
 */
@Controller
@RequestMapping("/test")
public class TestController {
    @Autowired
    private TestServices testServices;

    @RolesAllowed("ROLE_ADMIN")
    @RequestMapping("/t1")
    public String t1(){
        testServices.t1();
        return "index";
    }
    @RolesAllowed("ROLE_USER")
    @RequestMapping("/t2")
    public String t2(){
        testServices.t2();
        return "index";
    }
    @RequestMapping("/t3")
    @RolesAllowed({"ROLE_ADMIN","ROLE_USER"})
    public String t3(){
        testServices.t3();
        return "index";
    }

}
